const express = require('express');
const router = express.Router();
const orderController = require('../controllers/orderController');

// 获取所有订单
router.get('/', orderController.getAllOrders);

// 获取用户订单
router.get('/user', orderController.getUserOrders);

// 创建新订单
router.post('/', orderController.createOrder);

// 更新订单状态
router.put('/:id/status', orderController.updateOrderStatus);

// 根据 ID 获取订单
router.get('/:id', orderController.getOrderById);

// 删除订单
router.delete('/:id', orderController.deleteOrder);

module.exports = router; 